package com.example.taskdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.example.taskdemo.bean.DistrubtuionData;
import com.example.taskdemo.bean.PlayData;
import com.example.taskdemo.bean.PlayVideoData;
import com.example.taskdemo.tasks.BaseTask;
import com.example.taskdemo.tasks.DistrubutionTask;
import com.example.taskdemo.tasks.PlayTask;
import com.example.taskdemo.tasks.PlayVideoTask;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private static String TAG = "MainActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.playtest).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.d(TAG, "onClick: ");
                List<BaseTask> list = new ArrayList<>();
                list.add(new PlayTask(new PlayData("启动播报")));
                list.add(new DistrubutionTask(new DistrubtuionData("会议室")));
                list.add(new PlayTask(new PlayData("结束播报")));
                list.add(new PlayVideoTask(new PlayVideoData("播放视频")));
                DataSingle.getInstance().UPListTask(list);
            }
        });
    }
}